﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

using VietStar.Library.Commom.Module;

public partial class controls_client_cartviewer : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            Cart cart = (Cart)Session["cart"];
            Control control = Page.Form.FindControl("cartviewer");
            Label count = (Label)FindControls.Find("count", control);
            Label price = (Label)FindControls.Find("price", control);
            if (count != null && price != null)
            {
                if (cart.CartData != null)
                {
                    count.Text = cart.CartData.Count + " sản phẩm";
                    price.Text = cart.TotalPrice + " vnđ";
                }
            }
        }
    }
}
